package com.kgc.easyshopping.util;

import java.util.List;

public class PageInfo<T> {
    private Integer pageNow;
    private Integer pageSize;
    private Integer total;
    private Integer pages;
    private List<T> data;

    public Integer getPageNow() {
        return pageNow;
    }

    public void setPageNow(Integer pageNow) {
        this.pageNow = pageNow;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
        if(this.total>0){
            this.pages = this.total%this.pageSize==0?this.total/this.pageSize:this.total/this.pageSize+1;
        }
    }

    public Integer getPages() {
        return pages;
    }

    public void setPages(Integer pages) {
        this.pages = pages;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
